home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 23 / AACD 23.iso / AACD / Programming / tek / task / initlock.c < prev    next >
Encoding:
C/C++ Source or Header  |  2001-05-12  |  608 b   |  37 lines

  1.  
  2. #include "tek/exec.h"
  3. #include "tek/kn/exec.h"
  4.  
  5. /* 
  6. **    TEKlib
  7. **    (C) 2001 TEK neoscientists
  8. **    all rights reserved.
  9. **
  10. **    TBOOL TInitLock(TAPTR task, TLOCK *lock, TTAGITEM *tags)
  11. **
  12. **    initialize a locking object for accesses across tasks
  13. **
  14. */
  15.  
  16. static TINT destroylock(TLOCK *lock);
  17.  
  18. TBOOL TInitLock(TAPTR task, TLOCK *lock, TTAGITEM *tags)
  19. {
  20.     if (lock)
  21.     {
  22.         if (kn_initlock(&lock->lock))
  23.         {
  24.             lock->handle.destroyfunc = (TDESTROYFUNC) destroylock;
  25.             lock->handle.mmu = TNULL;
  26.             return TTRUE;
  27.         }
  28.     }
  29.     return TFALSE;
  30. }
  31.  
  32. static TINT destroylock(TLOCK *lock)
  33. {
  34.     kn_destroylock(&lock->lock);    
  35.     return 0;
  36. }
  37.